package com.example.dqhl.recycleviewdemo.activity.eventbus;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.example.dqhl.recycleviewdemo.R;
import com.example.dqhl.recycleviewdemo.event.EventBusMssage;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * eventbus  发送信息
 *
 * @author Guanluocang
 *         created at 2018/2/1 16:32
 */
public class SendMessageActivity extends AppCompatActivity {

    @BindView(R.id.tv_send)
    TextView tvSend;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_send_message);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.tv_send)
    public void onViewClicked() {
        EventBus.getDefault().post(new EventBusMssage("我是发送的数据！"));
        finish();
    }
}
